package com.masterclient.app.businessmodule.vipmodule.api;


import com.eoner.baselib.container.CommonBaseResponse;
import com.eoner.managerlibrary.netsign.core.FCRetrofitManager;
import com.masterclient.app.businessmodule.vipmodule.bean.OrderBean;
import com.masterclient.app.businessmodule.vipmodule.bean.SellerOrderDetail;
import com.masterclient.app.businessmodule.vipmodule.bean.ServiceOrderBean;
import com.masterclient.app.businessmodule.vipmodule.bean.ServiceOrderDetail;

import java.util.Map;

import io.reactivex.Observable;


public class SaleOrderListService {

    private static SaleOrderListApi api;
    private static SaleOrderListService instance;

    public static SaleOrderListService getInstance() {
        synchronized (SaleOrderListService.class) {
            if (instance == null) {
                instance = new SaleOrderListService();
            }
        }
        return instance;
    }

    private SaleOrderListService() {
        api = FCRetrofitManager.getInstance().getRetrofit().create(SaleOrderListApi.class);
    }

    /**
     * 零售订单
     */
    public Observable<CommonBaseResponse<OrderBean>> getOrderList(String status, int page, int pageSize) {
        return api.getOrderList(status,page,pageSize);
    }

    /**
     * 零售订单-已移交
     */
    public Observable<CommonBaseResponse<OrderBean>> getNotOrderList(int page, int pageSize) {
        return api.getNotOrderList(page,pageSize);
    }

    /**
     * 零售订单立即发货
     */
    public Observable<CommonBaseResponse> sellerOrderPush(Map<String,String> map) {
        return api.sellerOrderPush(map);
    }

    /**
     * 分销订单详情
     */
    public Observable<CommonBaseResponse<SellerOrderDetail>> sellerOrderDetail(String orderNo, int scene) {
        return api.SellerOrderDetail(orderNo,scene);
    }

    /**
     * 售后订单
     */
    public Observable<CommonBaseResponse<ServiceOrderBean>> getRefundList(String status, int page, int pageSize) {
        return api.getRefundList(status,page,pageSize);
    }

    /**
     * 待处理售后详情
     */
    public Observable<CommonBaseResponse<ServiceOrderDetail>> SellerRefundDetail(String refund_no) {
        return api.SellerRefundDetail(refund_no);
    }
}
